#include "gameoverscene.h"
#include <stdio.h>

GameOverScene::GameOverScene(float tiempo){

	this->tiempo=tiempo;
}



void GameOverScene::Init(){
	imgFondo.LoadFromFile("img/maquina.png");
	fondo.SetImage(imgFondo);
	//fondo.FlipY(true);
	//fondo.SetColor(sf::Color(255, 255, 255, 100));
	
	sprintf(aux,"Time: %3.3f",tiempo);	
	strTiempo.SetText(aux);
	strTiempo.SetPosition(200,400);

	gameOverText.SetSize(50);
	gameOverText.SetText("GAME OVER");
	gameOverText.SetCenter(gameOverText.GetRect().GetWidth()/2, gameOverText.GetRect().GetHeight()/2);
	gameOverText.SetPosition(280, 240);
	gameOverText.SetColor(sf::Color(255, 255, 255));

	strMensaje.SetPosition(100,500);
        strMensaje.SetSize(20);
        strMensaje.SetColor(sf::Color::White);
        strMensaje.SetText("Press any key to continue");



}
void GameOverScene::CleanUp(){}
void GameOverScene::ProcessEvent(const sf::Event &e){
	if(e.Type == sf::Event::KeyPressed || e.Type == sf::Event::MouseButtonPressed || e.Type==sf::Event::JoyButtonPressed){
		EndScene();
	}
}
void GameOverScene::Update(const float &dt){
}

void GameOverScene::Render(sf::RenderWindow &w){
	w.Clear(sf::Color::Black);
	w.Draw(fondo);
	w.Draw(gameOverText);
	w.Draw(strTiempo);
	w.Draw(strMensaje);
}
